http://pastebin.com/wFty3QVm#